﻿using MvcETicaretDenemesi.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcETicaretDenemesi.Controllers
{
    public class ProductController : Controller
    {
        EDBDataContext DB = new EDBDataContext();
        //
        // GET: /Product/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult List()
        {
            short productListId = short.Parse(RouteData.Values["id"].ToString());
            return View(new IndexLists { ProductListe= DB.Products.Where(a=>a.CategoryId == productListId).ToList() });
        }

    }
}
